package cn.fsd.mapper;

import cn.fsd.domain.CommodityClass;
import cn.fsd.query.delivery.ClassQuery;
import cn.fsd.vo.ClassItem;
import cn.fsd.vo.ClassTreeRoot;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface CommodityClassMapper {
    int deleteByPrimaryKey(String class_id);

    int insert(ClassItem record);

    ClassTreeRoot selectByPrimaryKey(String class_id);

    List<CommodityClass> selectAll();

    int updateByPrimaryKey(ClassItem record);

    List<ClassTreeRoot> getAllClass();

    List<CommodityClass> getFirstClasses();

    List<ClassTreeRoot> getFirstClassesByPage(ClassQuery query);

    List<ClassTreeRoot> getClassesByParent(String parentId);

    void deleteByParentId(String class_id);

    CommodityClass getByName(String name);

    /**
     * 根据id获取class domain对象
     * @param classId id
     * @return class对象
     */
    CommodityClass selectById(String classId);

    /**
     * 根据分类名称模糊查询分类
     * @param className 分类名称
     */
    List<CommodityClass> getByNameVague(String className);
}